<#-- 导入模版定义文件-->
<#include "../template/template_editPage.ftl">
<@edit title="优先级操作">
    <#if (priority.id)??>
        <#assign isEdit = true />
    <#else>
        <#assign isAdd = true />
    </#if>
<body class="input">
<script type="text/javascript">
    $().ready(function () {

        var $validateErrorContainer = $("#validateErrorContainer");
        var $validateErrorLabelContainer = $("#validateErrorContainer ul");
        var $validateForm = $("#validateForm");
        var $tab = $("#tab");

        // Tab效果
        $tab.tabs(".tabContent", {
            tabs:"input"
        });

        // 表单验证
        $validateForm.validate({
            errorContainer:$validateErrorContainer,
            errorLabelContainer:$validateErrorLabelContainer,
            wrapper:"li",
            errorClass:"validateError",
            ignoreTitle:true,
            rules:{
                "priority.name":{
                    required:true
                }
            },
            messages:{
                "priority.name":{
                    required:"请填写面额编号"
                }
            },
            submitHandler:function (form) {
                $(form).find(":submit").attr("disabled", true);
                form.submit();
            }
        });
		<#if actionErrors??&&(actionErrors?size > 0)>
			$.dialog({type: "warn", content: "<#list errorMessages as list>${list}<br></#list>",
			 modal: true, autoCloseTime: 3000});
		</#if>
    });
</script>
<div class="body">
    <div class="inputBar">
        <h1><span class="icon">&nbsp;</span><#if isAdd??>添加优先级<#else>编辑优先级</#if></h1>
    </div>
    <div style="display: none;" id="validateErrorContainer" class="validateErrorContainer">
        <div class="validateErrorTitle">以下信息填写有误,请重新填写</div>
        <ul></ul>
    </div>
    <form id="validateForm" class="validate" method="post"
          action="<#if isAdd??>${web_base}/recharge/priority!doAdd.htm<#else>${web_base}/recharge/priority!doEdit.htm</#if>">
        <table class="inputTable tabContent">
            <tr>
                <th>供货商提供的充值面额编号:<input type="hidden" name="priority.id" value="<#if isEdit??>${(priority.id)!}</#if>">
                </th>
                <td><input type="text" class="formText" name="priority.supplyDenominationId" value="${(priority.supplyDenominationId)!}"><label
                        class="requireField">*</label></td>
            </tr>
            <tr>
                <th>优先级:</th>
                <td><input type="text" id="" class="formText" name="sort" value="${(priority.sort)!}"><label class="requireField">*</label></td>
            </tr>
            <tr>
                <th>是否启用:</th>
                <td><select name="priority.enable">
                    <option value="false" <#if isEdit??><#if priority.enable?string('true','false')=="false">selected="selected"</#if></#if> >
                        否
                    </option>
                    <option value="true"  <#if isEdit??><#if priority.enable?string('true','false')=="true">selected="selected"</#if></#if> >
                        是
                    </option>
                </select>
                </td>
            </tr>
            <tr>
                <th>是否删除:</th>
                <td><select id="" name="priority.deleted">
                    <option value="false" <#if isEdit??><#if priority.deleted?string('true','false')=="false">selected="selected"</#if></#if> >否</option>
                    <option value="true" <#if isEdit??><#if priority.deleted?string('true','false')=="true">selected="selected"</#if></#if> >是</option>
                </select></td>
            </tr>
        </table>
        <div class="buttonArea">
            <input type="submit" class="formButton" value="<#if isAdd??>添加<#else>修改</#if>" hidefocus="true"/>&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="button" class="formButton" onclick="window.history.back(); return false;" value="返  回"
                   hidefocus="true"/>
        </div>
    </form>
</div>
</body>

</@edit>